<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:p="http://primefaces.prime.com.tr/ui"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets">

<h:head>
	<style type="text/css">
		.nomeQuery {
			width: 200px;
			text-align: center;
		}
		
		.inicioQuery {
			width: 50px;	
			text-align: left;
		}
		
		.fimQuery {
			width: 50px;
			text-align: left;
		}
		
		.sequenciaQuery {
			width: 300px;
			text-align: left;
		}
		
		.nomeSubject {
			width: 300px;
			text-align: center;
		}
		
		.inicioSubject {
			width: 50px;	
			text-align: left;
		}
		
		.fimSubject {
			width: 50px;
			text-align: left;
		}
		
		.sequenciaSubject {
			width: 500px;
			text-align: left;
		}
		
		.evalue {
			width: 50px;
			text-align: center;
		}
		
		.score {
			width: 50px;
			text-align: center;
		}
		
		.identidade {
			width: 50px;
			text-align: right;
		}
	
	</style>
</h:head>
<h:body onload="foco();">
	<ui:composition template="../template.xhtml">
		<ui:define name="miolo">
   			<p:growl id="erros"/> 
			<h:form id="LSAnalise">
				<p:panel id="panel" header="#{msgs.blastExecute}">
					<table width="100%">
						<tr valign="middle">
							<td align="right"><p:commandButton value="#{msgs.regress}"
									action="lista.faces" ajax="false"/>
							</td>
						</tr>
					</table>
					<table>
						<tr>
							<td><h:outputText value="Gene:" /> &nbsp; 
								<h:selectOneMenu
									styleClass="select" id="arquivoFasta"
									value="#{blastFrm.arquivoFastaSelecionado}">
									<f:selectItems value="#{blastFrm.arquivosFasta}" />
								</h:selectOneMenu>
							</td>
							<td>
								<p:commandButton
									value="#{msgs.blastExecute}" 
									action="#{blastFrm.executeBlast}"
									update="tabela,erros" />
							</td>
						</tr>
					</table>
					<table>
						<tr>
							<td><h:panelGrid style="width:1340px">
									<p:dataTable value="#{blastFrm.colecaoBlast}"
										emptyMessage="#{msgs.naoHaDados}" id="tabela" 
										var="item" paginator="true" rows="10"
										paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"  
        								rowsPerPageTemplate="10,20,50">
	        		
								        <p:columnGroup type="header">  
								            <p:row>  
								                <p:column colspan="3" headerText="Query" />  
								                <p:column colspan="3" headerText="Subject" />  
								            </p:row>  

								            <p:row>  
								                <p:column headerText="#{msgs.nameColumn}" />  
								                <p:column headerText="#{msgs.startColumn}" />  
								                <p:column headerText="#{msgs.endColumn}" />
								                
								                <p:column headerText="#{msgs.nameColumn}" />  
								                <p:column headerText="#{msgs.startColumn}" />  
								                <p:column headerText="#{msgs.endColumn}" />
								                
								                <p:column headerText="#{msgs.eValueColumn}" />  
								                <p:column headerText="#{msgs.scoreColumn}" />  
								                <p:column headerText="#{msgs.identityColumn}" />   
								            </p:row>  
								        </p:columnGroup>

							            <p:column> 
											<h:outputText value="#{item.nomeQuery}" />
										 </p:column> 
											
										<p:column>  
								            <h:outputText value="#{item.inicioQuery}" /> 
								        </p:column>  
								  
								        <p:column>  
								            <h:outputText value="#{item.fimQuery}" /> 
								        </p:column>  
								  
								        <p:column>  
								           <h:outputText value="#{item.nomeSubject}" />  
								        </p:column>  
								  
								        <p:column>  
								            <h:outputText value="#{item.inicioSubject}" />  
								        </p:column>
								        
								        <p:column>  
								           <h:outputText value="#{item.fimSubject}" />  
								        </p:column>
								        
								        <p:column>  
								            <h:outputText value="#{item.eValue}" />  
								        </p:column>
								        
								        <p:column>  
								            <h:outputText value="#{item.score}" />  
								        </p:column>
								        
								        <p:column>  
								            <h:outputText value="#{item.identidade}" /> 
									    </p:column>
								        
								        <p:columnGroup type="footer">
								        	<p:row>	
									        	<p:column> 
									        		<h:outputText value="#{item.coberturaQuery}" />
									        	</p:column>
									        </p:row>
									        	
									        <p:row>
									        	<p:column> 
									        		<h:outputText value="#{item.coberturaSubject}" />
									        	</p:column>	
									        </p:row>
								       	</p:columnGroup>		        
							        									
									</p:dataTable>
								</h:panelGrid>
							</td>
						</tr>
						<tr>
							<td><h:panelGrid style="width:100%">
									<p:panel header="#{msgs.exportColumn}">
										<h:commandLink>
											<p:graphicImage title="#{msgs.exportColumn} Excel"
												value="../images/excel.png" />
											<p:dataExporter type="xls" target="tabela" fileName="Resumo"
												excludeColumns="0" />
										</h:commandLink>

										<h:commandLink>
											<p:graphicImage title="#{msgs.exportColumn} PDF"
												value="../images/pdf.png" />
											<p:dataExporter type="pdf" target="tabela" fileName="Resumo"
												excludeColumns="0" />
										</h:commandLink>

										<h:commandLink>
											<p:graphicImage title="#{msgs.exportColumn} CSV"
												value="../images/csv.png" />
											<p:dataExporter type="csv" target="tabela" fileName="Resumo"
												excludeColumns="0" />
										</h:commandLink>

										<h:commandLink>
											<p:graphicImage title="#{msgs.exportColumn} XML"
												value="../images/xml.png" />
											<p:dataExporter type="xml" target="tabela" fileName="Resumo"
												excludeColumns="0" />
										</h:commandLink>

									</p:panel>
								</h:panelGrid>
							</td>
						</tr>
					</table>
				</p:panel>
			</h:form>
		</ui:define>
	</ui:composition>
</h:body>
</html>


